Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
abhaysingh
Specialist II
Specialist II

Logic help

Hi All,

Pls help me in this logic,

I have three values against product,

Say if i select month than it shud give me month value of product, else let say product   found in a selected month, than it shud check overall year and give the value as per whole year,  against null in selected month, else let against any product inMonth, and inYear value not found or than it will pick value from different table field let say Field1.

So what  i have calculate yet is,

MOnth wise value, year wise value and Field1 value against product in a staright table,

Now i have a scenario of data like below

    

ProductMonth ValueYear ValueField1
A1012
B1113
C10  20
D10

Now u can see Against product A and B, there is a value against Month so need to pick first Month value, than u can see Against C, Month value is null, than need to pick Year value and for D , Month and Year value is null, than need to pick Field1 value.

For C, u can see there is a value for Year and Field1, first condition need to fulfill first, for C Year value, need to consider.

7 Replies
ajsjoshua
Specialist
Specialist

Hi,

Try with if statement

lik if monthvalue&Yearvalue is <=0,field1exp,Monthvalue and yearvalue exp.

Regards,

Joshua.

PradeepReddy
Specialist II
Specialist II

take a straight table..

Dimension : Product

Expression :

=if(len(trim([Month Value]))>0,[Month Value],

  if(len(trim([Year Value]))>0,[Year Value],

  if(len(trim(Field1))>0,Field1)))

Anonymous
Not applicable

like this?

Dim: Product

Expression: =sum(if( isnull([Month Value]), if( isnull([Year Value]), Field1,[Year Value]), [Month Value]))

abhaysingh
Specialist II
Specialist II
Author

Hi,

I have exp like this

Month Value Rate

=((sum(total <ProdGrp> BudgetQty*BudgetRate *ExchangeRate)

+

sum(TOTAL <ProdGrp> BudgetQty* BudgetRate* ExchangeRate* PriceDifference)*.01)

-

Sum(TOTAL <ProdGrp>((BudgetQty*BudgetRate*ExchangeRate)+(BudgetQty*BudgetRate*ExchangeRate*(PriceDifference)/100))*(SpecDesc)/100))

/

sum(TOTAL<ProdGrp> BudgetQty)


Year Value Rate

=((sum(total <ProdGrp>{<Month>} BudgetQty*BudgetRate *ExchangeRate)

+

sum(TOTAL <ProdGrp>{<Month>} BudgetQty* BudgetRate* ExchangeRate* PriceDifference)*.01)

-

Sum(TOTAL <ProdGrp> {<Month>}((BudgetQty*BudgetRate*ExchangeRate)+(BudgetQty*BudgetRate*ExchangeRate*(PriceDifference)/100))*(SpecDesc)/100))

/

sum(TOTAL<ProdGrp> {<Month>} BudgetQty)

Sale Rate

=SaleRate

I want in above expression,

when Month Value Rate is blank or null give me Year Value Rate and if Year Value Rate is null or blank give me SaleRate

Kindly Help me in this

abhaysingh
Specialist II
Specialist II
Author

any suggestion?

Anonymous
Not applicable

Try like this?

=if([Month Value Rate Expression]='' or null(),

  if([Year Value Rate Expression]=' ' or null(), SalesRate, [Year Value Rate Expression]))

Anonymous
Not applicable

For your expression, try this?

Assuming your expression syntax is ok


=if((((sum(total <ProdGrp> BudgetQty*BudgetRate *ExchangeRate)

+

sum(TOTAL <ProdGrp> BudgetQty* BudgetRate* ExchangeRate* PriceDifference)*.01)

-

Sum(TOTAL <ProdGrp>((BudgetQty*BudgetRate*ExchangeRate)+(BudgetQty*BudgetRate*ExchangeRate*(PriceDifference)/100))*(SpecDesc)/100)) /sum(TOTAL<ProdGrp> BudgetQty)) = ' '

,


if((((sum(total <ProdGrp>{<Month>} BudgetQty*BudgetRate *ExchangeRate)

+

sum(TOTAL <ProdGrp>{<Month>} BudgetQty* BudgetRate* ExchangeRate* PriceDifference)*.01)

-

Sum(TOTAL <ProdGrp> {<Month>}((BudgetQty*BudgetRate*ExchangeRate)+(BudgetQty*BudgetRate*ExchangeRate*(PriceDifference)/100))*(SpecDesc)/100))

/sum(TOTAL<ProdGrp> {<Month>} BudgetQty)) = ' '

,

SalesRate

,

(((sum(total <ProdGrp>{<Month>} BudgetQty*BudgetRate *ExchangeRate)

+

sum(TOTAL <ProdGrp>{<Month>} BudgetQty* BudgetRate* ExchangeRate* PriceDifference)*.01)

-

Sum(TOTAL <ProdGrp> {<Month>}((BudgetQty*BudgetRate*ExchangeRate)+(BudgetQty*BudgetRate*ExchangeRate*(PriceDifference)/100))*(SpecDesc)/100))

/sum(TOTAL<ProdGrp> {<Month>} BudgetQty))))