Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

dynamic_girl
Contributor

urgent requirement

what I want is a dynamic variable to compare previous month to 12 months data,

and also if I make any selections in the list box so my text objects shud be updated,

current month:user selection

how to do that

10 Replies

Re: urgent requirement

That is how default Variable can do? What is the issue you are facing?

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
dynamic_girl
Contributor

Re: urgent requirement

how to create that variable

Re: urgent requirement

Perhaps this?

LET Var = Sum({<Month = {">=$(=AddMonths(Max(Month),-1))<=$(=AddMonths(Max(Month),12))"}>} Sales)

Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)
dynamic_girl
Contributor

Re: urgent requirement

it shud be treated as a ratio:

like current data view(with latest date data):user selection

I have a datefield in format dd/mm/yyyy

dynamic_girl
Contributor

Re: urgent requirement

kindly help as its a urgent requirement .

dynamic_girl
Contributor

Re: urgent requirement

count({<datefield={'$(variable1)'},field2-={'value'}>}distinct id)

variable1=addmonths(datefield,-12)

why its not wrking.

dynamic_girl
Contributor

Re: urgent requirement

it shub be last year data -current one

suppose the current is 1stfeb2018

1stfeb2018-1stfeb2017

how to create this type of variable

dynamic_girl
Contributor

Re: urgent requirement

thanks anil,

my requirement is by default the view shud be of last year ,

but if a user made any selection,so this shud change accordingly,

basically I have done like below

count({<date={'$(vriable1)'}>}distinct field)
-
count({<date={'$(vriable2)'}+ {'$(variable3)'} >}distinct field)

here variable1:captures my max date

variable2:last year date

variable3:user selected date from list box

but its just giving me frst output

in case of second the difrnce is not correct ,I thought of putting OR condition with a + sign ,its  not wrking as desired?

Re: urgent requirement

I know where you made mistake, Will you able to provide application. Perhaps this?

count({<date={'$(variable2)'}>+ <{'$(variable3)'} >}distinct field)


Before develop something, think If placed (The Right information | To the right people | At the Right time | In the Right place | With the Right context)