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

need help


Hi I have a requirement like below

CountrySTARTTIMEENDTIMESALES/ORDERS
SALES_US06/24/1406/24/14100
ORDERS_US06/24/1406/24/14200
SALES_UK06/24/1406/23/14150
ORDERS_UK06/23/1406/24/14250
SALES_IN06/24/1406/23/1480
ORDERS_IN06/24/1406/24/14120

output looks like below

CountrySalesOrdersSalesStatus(If STARTTIME=ENDTIME I need to display Green Traffic light else red Red Traffic light)
US100200
  • (green color Traffic light)
UK150250
  • (red color)
IN80120
  • (redcolor)

same logic as for Order Status also.

Can any one help me out thanks in advance

1 Solution

Accepted Solutions
Not applicable
Author

In the script you do the following:

TEMP:

LOAD * INLINE [

Country, STARTTIME, ENDTIME, SALES

SALES_US, 06/24/14, 06/24/14, 100

SALES_UK, 06/24/14, 06/23/14, 150

SALES_IN, 06/24/14, 06/23/14, 80

ORDERS_US, 06/24/14, 06/24/14, 200

ORDERS_UK, 06/23/14, 06/24/14, 250

ORDERS_IN, 06/24/14, 06/24/14, 120];

DATA:

NOCONCATENATE

LOAD *,

  right(Country, 2) as [Country Short],

  left(Country, 1) as [Order Type]

RESIDENT TEMP;

DROP TABLE TEMP;

And in the chart you do the following:

=if(STARTTIME = ENDTIME, 'qmem://<bundled>/BuiltIn/led_g.png', 'qmem://<bundled>/BuiltIn/led_r.png')

Regards,

Marius

View solution in original post

10 Replies
Anonymous
Not applicable
Author

See attachment!

Not applicable
Author

Hi Swathi,

Please find attached.

Not applicable
Author

Hi Satyadev

thanks for quick response but I am using personal edition in my desktop unable to open,can you please share the logic here

Thanks

Swathi

alexandros17
Partner - Champion III
Partner - Champion III

My Example

MayilVahanan

Hi

PFA

Edit:

Load If(WildMatch(Country, '*Sales*'), [SALES/ORDERS],0) AS Sales, If(WildMatch(Country, '*Orders*'), [SALES/ORDERS],0) AS Orders, SubField(Country,'_',2) As CountryName, *;

LOAD * INLINE [

    Country, STARTTIME, ENDTIME, SALES/ORDERS

    SALES_US, 06/24/14, 06/24/14, 100

    ORDERS_US, 06/24/14, 06/24/14, 200

    SALES_UK, 06/24/14, 06/23/14, 150

    ORDERS_UK, 06/23/14, 06/24/14, 250

    SALES_IN, 06/24/14, 06/23/14, 80

    ORDERS_IN, 06/24/14, 06/24/14, 120

];

In Chart

CountryName As Dimension

Expression:

=Sum(Sales)

Sum(Orders)

=If(ENDTIME = STARTTIME, 'qmem://<bundled>/BuiltIn/led_g.png','qmem://<bundled>/BuiltIn/led_r.png')

Thanks & Regards, Mayil Vahanan R
Please close the thread by marking correct answer & give likes if you like the post.
Not applicable
Author

In the script you do the following:

TEMP:

LOAD * INLINE [

Country, STARTTIME, ENDTIME, SALES

SALES_US, 06/24/14, 06/24/14, 100

SALES_UK, 06/24/14, 06/23/14, 150

SALES_IN, 06/24/14, 06/23/14, 80

ORDERS_US, 06/24/14, 06/24/14, 200

ORDERS_UK, 06/23/14, 06/24/14, 250

ORDERS_IN, 06/24/14, 06/24/14, 120];

DATA:

NOCONCATENATE

LOAD *,

  right(Country, 2) as [Country Short],

  left(Country, 1) as [Order Type]

RESIDENT TEMP;

DROP TABLE TEMP;

And in the chart you do the following:

=if(STARTTIME = ENDTIME, 'qmem://<bundled>/BuiltIn/led_g.png', 'qmem://<bundled>/BuiltIn/led_r.png')

Regards,

Marius

Not applicable
Author

O yeah. And you have to change the presentation to Image in the Expression tab for that specific expression in the Straight Table.

Not applicable
Author


Thanks all for your quick responses

Anonymous
Not applicable
Author

Here is the backend script,

TBL:

LOAD SubField(Country, '_',2) as Country,

  STARTTIME,

  ENDTIME,

  If(SubField(Country, '_',1)='SALES', [SALES/ORDERS]) as SALES,

  If(SubField(Country, '_',1)='ORDERS', [SALES/ORDERS]) as ORDERS

INLINE [

    Country, STARTTIME, ENDTIME, SALES/ORDERS

    SALES_US, 06/24/14, 06/24/14, 100

    ORDERS_US, 06/24/14, 06/24/14, 200

    SALES_UK, 06/24/14, 06/23/14, 150

    ORDERS_UK, 06/23/14, 06/24/14, 250

    SALES_IN, 06/24/14, 06/23/14, 80

    ORDERS_IN, 06/24/14, 06/24/14, 120

];

In front end, create straight table chart,

table.PNG.png

Dimension:

County

Expression:

SALES column: Sum (SALES)

ORDERS column: Sum (ORDERS)

Status: If(STARTTIME=ENDTIME, 'qmem://<bundled>/BuiltIn/led_g.png','qmem://<bundled>/BuiltIn/led_r.png')

Remember to select "Keep Aspect" from Image formatting option available on expression tab for Status.