Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Writing an expression that encompasses data in 2 tables

I am trying to formulate an expression that encompasses data from two tables:-

Table1:

Amount,

Table2:

if(wildmatch(Rate_Category, 'A*'), 'Unmeasured',

     if(wildmatch(Rate_Category, 'U*'), 'Unmeasured')) as Unmeasured,

     if(wildmatch(Rate_Category, 'M*'), 'Measured') as Measured,

I am trying to get an amount for Unmeasured and Measured in seperate fields.

Paul.

8 Replies
Not applicable
Author

Anyone? I'm sat here bashing my head off a desk

mdmukramali
Specialist III
Specialist III

Dear,

Paul.

can you explain what do u want , some what clearly?

Not applicable
Author

try with:

if(left(Rate,1)='A' or left(Rate,1)='U','Unmeasured',

if(left(Rate,1)='M','Measured')) as Type

Hope this can help you

Not applicable
Author

That did give me some pointers, ive gone away from trying to entirely calculating it all in an expression.

Ive tried this which I cant get it to work.

if(left(Rate_Category,1)='A' or left(Rate_Category,1)='U', sum(Amount)) as unmeasured_Total,

if(left(Rate_Category,1)='M',Sum(Amount)) as Measured_Total,

What im trying to do is for the 1st line where the rate category starts with A or U to be counted by (Amount) as unmeasured_total

For the 2nd line  where Rate Category begins with M to be be counted as Measured_Total. Qlickview rejects this which ever way round I try it. Please help.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

     You may look in to this

     Sum({<Rate_Category={'A*','U*'}>} Amount) for unmeasured_Total

     Sum({<Rate_Category={'M*'}>} Amount) for Measured_Total

Hope it helps

Celambarasan

Not applicable
Author

doesnt work, probably I forgot to mention that I have this script before this in the same table.

if(wildmatch(Rate_Category, 'A*'), 'Unmeasured',

if(wildmatch(Rate_Category, 'U*'), 'Unmeasured')) as Unmeasured,

if(wildmatch(Rate_Category, 'M*'), 'Measured') as Measured,

Sum({<Rate_Category={'A*','U*'}>} Amount) for unmeasured_Total

     Sum({<Rate_Category={'M*'}>} Amount) for Measured_Total

isnt working, also my company is running version 9 of Qlickview, please help!

Paul.

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

    

Table1:

Load

Rate_Category,

Amount

From..

Left Join(Table1)

Load

     Rate_Category,

     if(wildmatch(Rate_Category, 'A*'), 'Unmeasured',

     if(wildmatch(Rate_Category, 'U*'), 'Unmeasured')) as Unmeasured,

     if(wildmatch(Rate_Category, 'M*'), 'Measured') as Measured

From..

UnMeasured:

Load

     Rate_Category,

     Amount as unmeasure_Total

Resident Table1 where Unmeasured<>null();

Measured:

Load

     RateCategory,

     Measure_Total

Resident

     Table1 where Measured <> null();

Celambarasan

Not applicable
Author

Struggling to get that to work, even when i filled in the table names, surely there must be a much simpler way to do it

if(wildmatch(Rate_Category, 'A*'), 'Unmeasured',

if(wildmatch(Rate_Category, 'U*'), 'Unmeasured')) as Unmeasured,

if(wildmatch(Rate_Category, 'M*'), 'Measured') as Measured

Unmeasured and measured is a number of customers. I just want to get the value these 2 groups owe in  (£) as the field 'Amount'.

Im looking at building this in the same table (sorry being simple as i'm new to qlickview)

If customer is unmeasured please give me the amount represented by this value.