Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

set analysis and if

Hi,

if have variable which contains if and set analysis and i dont want to change it.

but if i want to add if before the variable - the answer is not correct.

for example - Sales=

$(vMeasure) =if(VAT='NO VAT', sum( {< YEAR = {$(vCurrYear)} >} [TOTAL SALE)],sum( {< YEAR = {$(vCurrYear)} >}[TOTAL SALE AND VAT]))

now i want to show sales for branch 121 all the time (but still without changing $(vMeasure)


Sum({<branch={121}>} aggr ($(vMeasure_CY),[month and year]))  - But it doesnt work

How can i do it??

help

11 Replies
Anonymous
Not applicable
Author

Hi,

Please try Sum({<branch={'121'}>} aggr ($(vMeasure_CY),[month and year]))

and $(vMeasure) =if(VAT='NO VAT', sum( {< YEAR = {$(vCurrYear)} >} [TOTAL SALE]),sum( {< YEAR = {$(vCurrYear)} >}[TOTAL SALE AND VAT]))

Anonymous
Not applicable
Author

Hi ,

thank for you answer - but i dont understand your answer ..

which line should i try ?

the  $(vMeasure)  should stay without any change

Gysbert_Wassenaar
Partner - Champion III
Partner - Champion III

Can you post a small qlikview document that demonstrates the problem?


talk is cheap, supply exceeds demand
Anonymous
Not applicable
Author

its a bit problem because im using excel and  havr lot of sources

sunny_talwar

I agree with Gysbert, would you be able to share a sample to look at the issue?

avinashelite

Did not understand your problem , could you please elaborate bit more with sample output required 

Anonymous
Not applicable
Author

Hi again ,

i'll try to be more clear about it -

i have a variable in my model - $(vMeasure_CY)

this variable show the sales for the current year..


i'm trying to write this set (i dont want to change $(vMeasure_CY) 😞

Sum({<branch={'121'}>} aggr ($(vMeasure_CY),[month and year]))



but without any success...

Anonymous
Not applicable
Author

i actually want the sales of the current year for branch 121  using $(vMeasure_CY) )

Anonymous
Not applicable
Author

Hi,

I saw some syntax errors so I thought maybe that is why your script was not working