Qlik Community

New to Qlik Sense

If you’re new to Qlik Sense, start with this Discussion Board and get up-to-speed quickly.

Announcements
Tell us which business and trade publications you read most regularly: RESPOND NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
siddharthsoam
Partner - Creator II
Partner - Creator II

How can i apply condition in a group by expression.

Hi,

I want only those customers to come with revenue< 1mn corresponding to my previous_fiscal year i.e. 1-max(fiscal year). But when I apply the following condition-

Temp:

Load

((Max(Mid("Fiscal Year",3)))-1) as Prevfiscalyear

Resident PNL;

Let vPrevfiscalyear =Peek('Prevfiscalyear');

tab2:

Load

"Fiscal Year",

Quarters,

"Customer ",

leaders,

if(sum(Revenue)<1,'Tail Accounts(Rev<1Mn)',

) as Accounts

Resident PNL

where "Fiscal Year"=$(vPrevfiscalyear)

Group by "Fiscal Year","Customer ="leaders;


I cannot see any customer corresponding to FY18 selection at frontend


2 Replies
bramkn
Partner - Specialist
Partner - Specialist

The following will not work: Group by "Fiscal Year","Customer ="leaders;

krishna_2644
Specialist III
Specialist III

Share a mock - up or seee below for suggestions -


Temp:

Load

((Max(Mid("Fiscal Year",3)))-1) as Prevfiscalyear

Resident PNL;

Let vPrevfiscalyear =Peek('Prevfiscalyear');  //Table name not mentioned eg : peek('Prevfiscalyear',0,minmax)

tab2:

Load

"Fiscal Year",

Quarters,

"Customer ",

leaders,

if(sum(Revenue)<1,'Tail Accounts(Rev<1Mn)',

) as Accounts   // if (Rev<1Mn is condition, then this if() statement will not work - syntax errors//

Resident PNL

where "Fiscal Year"=$(vPrevfiscalyear)

Group by "Fiscal Year","Customer ="leaders; //group by will not work as the number of load fields not equals to group by fields.Also you cannot have operators in a group by//