Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

Announcements
QlikWorld, June 24-25, 2020. Free virtual event for DI and DA gurus. Register Today
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor

Disable inputfield in a table for past months

Hi all,

I have a table of sales with customer, item, month and quantity.

I setted the quantity to be an input field in order to let the user to input some values, and this works.

Then I would like to let the user to modify the quantity only for the future months, and the past months should be a readonly field.

I tried to do something like this:

if (

  month_id >= Year(Today())*100+Month(Today())

  , InputSum ( forecast_qty_SIM )

)

but the field is always in read only.

(I have already checked the condition and it is correct)

Do you have any idea?

Thanks

stefano

Tags (1)
7 Replies
Highlighted
Not applicable

Re: Disable inputfield in a table for past months

what is the value of month id - in the coce you provided above, the expression Year(Today())*100+Month(Today()) will result in the value of 201512?

you may need to put parenthesis around either side of the '*' but the number comes out very high

=(Year(Today()))*(100+Month(Today()))

what date or value are you expecting???

Highlighted
Not applicable

Re: Disable inputfield in a table for past months

year(today()) * 100 = 210500?

Highlighted
Contributor
Contributor

Re: Disable inputfield in a table for past months

Hi Adam,

month_id field is in the format YYYYMM and the condition "Year(Today())*100+Month(Today())" returns the data in the same format (es. 201512).

My question is: how can I set the future month with the inputfield, and past months without it?

Thanks

stefano

Highlighted
Not applicable

Re: Disable inputfield in a table for past months

can you supply a,list of month_id values that are in your applciaiton.  It looks like you are comparing 2 YYYYMM fields to each other.

have you tried having both fields in the num format?

can you post a sample qvw?

Highlighted
Contributor
Contributor

Re: Disable inputfield in a table for past months

Adam, the issue is not on the date condition (it works, I am sure about this).

My problem is how to set a field to be input field in some conditions, and to be a read only field in other condition.

In my example the condition was based on the month, but it could be based also on the customer, or on the item.

Thanks

stefano

Highlighted
MVP
MVP

Re: Disable inputfield in a table for past months

I don't think you can enable / disable the input field per dimension value at all using a conditional

Have you seen a demo showing this somewhere?

Highlighted
Not applicable

Re: Disable inputfield in a table for past months

I understand what you are trying to do much better but as swuehl said, I do not believe you can change a dimesnion in that manner

some other options might be is to when you write out your data, you can do the check at tht point or there are more advanced extension objects that handle updating of fields, but that is updating the source of the data (the extensions are from KT Labs - )