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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
raadwiptec
Creator II
Creator II

wildmatch and sum

Hi ,

I have a pivot table..

first I need to consolidate all the wild match name to one name

for ex: column name is 'Postion' - data is as below.

moved, transit, moved out,moved in,outin moved, transitout,transitin..etc

so I need to have all the moved in wildmatch and have common name as 'moved'

secondly I have cost for each position for

moved

cost is 100 pounds

moved out

cosit is 150 pounds

etc.

so when making the postion as moved ..I also need the sum of all the cost ..it should be like this

Moved(It includes as moved)

250 (It is sum of cost for all moved)

1 Solution

Accepted Solutions
jonas_rezende
Specialist
Specialist

Hi, raadwiptec g .

Try:

In Script

Table:

LOAD

if(WILDMATCH(POSITION,'*Moved*'),'Moved','Transit') AS Category,

POSITION,

COST;

LOAD * Inline [

POSITION, COST

Moved, 100

Moved Out, 150

MovedIn, 200

Out Moved, 250

In Transit, 100

Out Transit, 200

];

In Sheet.

Thread196434.png

Hope this helps.

View solution in original post

32 Replies
Chanty4u
MVP
MVP

sum(moved)/sum(total moved)

or

sum(moved)/sum(All moved)

PrashantSangle

Hi,

What is your table structure for maintain the cost???

Is it maintain in same table or different table??

For your 1st query try to create new field in script like

if(wildmatch(postion,'*moved*'),'Moved',postion) as newPostion

then use newly created field as dimension and sum(Cost) as expression.

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
raadwiptec
Creator II
Creator II
Author

Hi

First I need to name all the wild matched names to a single name?

for ex: if wildmatch(Position ,'*moved*') ,Postions

here I get all the values in different column.. I need in one column

jonathandienst
Partner - Champion III
Partner - Champion III

Could you please supply some more representative data. What dimension/grouping do you need for this analysis?

Logic will get you from a to b. Imagination will take you everywhere. - A Einstein
Anonymous
Not applicable

Different Column in Different Tables??

or

Different Column in same table??

Could you share sample data?

Chanty4u
MVP
MVP

If(WildMatch([Position ],'*moved*'), 'moved', 'movedout')

PrashantSangle

Hi,

did you try my suggestion???

Try below.

if(wildmatch(postion,'*moved*'),'Moved',postion)


Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
raadwiptec
Creator II
Creator II
Author

It is in the same table. I want to consolidate all moved using wildmatch into one single name ' Moved' similarly 'Transit

Add all the cost for moved .I am trying this in an expression

so it should be as below. even country in same table

Its a pivot table

                     Moved ¦ transit

UK                   700        300

   

PositionCost
Moved100
MovedOut150
MovedIn200
OutMoved250
InTransit100
Outtransit200
PrashantSangle

Hi,

Can you post sample data and your script to load that file...

Regards

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂