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

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
er_mohit
Master II
Master II

If and Else Logic on backend

Hi ,

I have a data like below.

Year:

LOAD

* Inline [

Month,Year

1,2014

2,2014

3,2014

4,2014

5,2014

6,2014

7,2014

8,2014

1,2013

2,2013

3,2013

4,2013

5,2013

6,2013

7,2013

8,2013

9,2013

10,2013

11,2013

12,2013

];

If User select Year = 2013

i want an if condition logic that

In above i have 1 to 12 minth for Year = 2013 and for Year = 2014 Month is 1 to 8

I want to create a dimension based on MaxMonth group by year.

Compare that MaxMonth with given Month group by Year.

So, what i want the logic made like below

So, my logic is if Month = 1,'Jan',

Month<=2,'Jan & Feb',

Month>=1 and Month <=3,'Q1',

Month<=4  ,'Apr',

Month>=4 and Month<=5,'Apr & May',

Month>=1 and Month<=6,H1,

Month=7,July,

Month>=7 and Month<=8 ,'July & Aug',

Month> = 7 and Month<=9,'Q3',

Month=10,'Oct',

Month>=10 and Month<=11,'Oct and Nov',

Month>=10 and Month<=12,'Q4',

Month>6 and Month<=12,'H2',

Month>=1 and Month<=12,'YTD Dec' as NewDimension 

here the static value m write is MaxMonth of that particular Year.

My Output:

So, for Year =2013

The Value having in NewDimension  field is

Q1

Q2

H1

Q3

Q4

H2

YTD Dec

if select Year = 2014

then in NewDimension field having value alike

Q1

Q2

H1

July & Aug

YTD Aug

Any help will be appreciable.

12 Replies
anbu1984
Master III
Master III

Try this

Load Count( DISTINCT Month ) As MthSum, Year Resident MasterCalendar Group by Year;

er_mohit
Master II
Master II
Author

Ok. Thanks for your reply.

i have tried it but the problem is it shows single value rather than consolidate data of month value as you suggested in above example for creating logic.

Please share the application demo if you have done it.

Regards

Mohit

anbu1984
Master III
Master III

Check this